package com.xuanxu.blogs.framework.web.config;

import com.xuanxu.blogs.framework.web.core.convert.JacksonObjectMapperConvert;
import com.xuanxu.blogs.framework.web.core.handler.GlobalExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @author XuanXu
 * @version 1.0
 * @date 2024-08-19 17:35
 */
@AutoConfiguration
public class WebConfiguration {

    /**
     * 全局异常处理器
     */
    @Bean
    public GlobalExceptionHandler globalExceptionHandler() {
        return new GlobalExceptionHandler();
    }

    /**
     * 消息转换器
     */
    @Bean
    public JacksonObjectMapperConvert jacksonObjectMapperConvert() {
        return new JacksonObjectMapperConvert();
    }
}
